//
//  MKUIThemeCenterElement.m
//  MKUI
//
//  Created by 苏尚进 on 2021/3/21.
//  Copyright © 2021 moon. All rights reserved.
//

#import "MKUIThemeCenterElement.h"
#import "MKUIThemeCenter.h"

@implementation MKUIThemeCenterElement
+ (instancetype)themeElementForKey:(NSString *)key{
    MKUIThemeCenterElement *el = [[self alloc] init];
    el.key = key;
    return el;
}
- (id<NSObject>)themeElement{
    id value = [[MKUIThemeCenter sharedInstance].currentTheme getElementValueWithKey:self.key];
    if(!value){
        value = [[MKUIThemeCenter sharedInstance].defaultTheme getElementValueWithKey:self.key];
    }
    return value;
}
#ifdef DEBUG
- (void)dealloc{
    
}
#endif
@end
